1. Technical Field
The technical field relates to a method of cloning data in a memory for a source virtual machine (VM) and at least one cloned virtual machine.
2. Background
System virtualization is the abstraction and pooling of resources on a platform. This abstraction decouples software and hardware and enables multiple operating system images to run concurrently on a single physical platform without interfering with each other. Virtualization can increase utilization of computing resources by consolidating workloads running on many physical machines into virtual machines running on a single physical machine. This consolidation can dramatically reduce power consumption and floor space requirements in the data center. Virtual machines can be provisioned on-demand, replicated and migrated using a centralized management interface.
To allow multiple operating systems to run on the same physical platform, a platform layer implemented in software decouples the operating system from the underlying hardware. This layer is called the hypervisor or virtual machine monitor (VMM). In context of system virtualization, the operating system being virtualized is referred to as guest. To properly virtualize and isolate a guest, the hypervisor or virtual machine monitor (VMM) must control or mediate all privileged operations performed by the guest. The hypervisor can accomplish this using various techniques.
Rapid or almost real time cloning of a virtual machine (VM) plays a notable feature in a virtualization environment or a platform for system virtualization. The technique may be adaptive to load balancing, pre-deployment testing, speculative execution, data mining, and, in a large data center, virus scanning or malware analysis. When unknown software is loaded or is ready for execution, the execution of the unknown software may be intercepted or interrupted by an antivirus program or an agent, and rapid cloning of VM may be requested in advance. The cloned VM has the same operating environment and status with the parent or original VM. The agent may discretionarily execute the unknown software as well as perform virus scanning or malware analysis. Even the execution of the software may cause the VM being crashed or paralysed; the original VM will not be affected because the damage will occur in the cloned VM.
In conventional art, live migration technique is implemented for rapid or almost real time cloning of the VM. Live migration allows a server administrator to move a running virtual machine or application between different physical machines without disconnecting the client or application. For a successful live migration, the memory, storage, and network connectivity of the virtual machine needs to be migrated to the destination. However, the cloning of the VM begins after the completion of data migration for the memory, storage, or disk, which may not satisfy the requirement of rapid or almost real time cloning of the VM.
In conventional art, snapshot mechanism is proposed for fast cloning VM and initializing the cloned VM. However, the original VM is required to be shut off or in a quiesced state, which makes the cloning of VM in executing state being achieved. The snapshot mechanism is adaptive to rapidly clone a large number of virtual machines, but not support real time isolation environment for cloning.
In other conventional art, during performing a process of cloning a source VM, the way to copy the data stored in the physical memory may copy the whole metadata of the source VM to the target VM. The metadata (for example, page tables) in the target VM will be redirected to the memory of the source VM. The information stored in all pages of the memory pointed by two metadata will be marked “read only”. Copy-on-write (COW) will be employed for access operations. However, in the page table directory (PTD) structure, the only way to set the page table entry (PTE) as read only is to traverse the whole page table, and change the read-flags of the total PTEs to be “read only”. The time for such operation will be almost the same as the time to copy the whole page table. The required time for such operation will be increased if the capacity of the memory is increased as desired. If the capacity of the memory reaches several GB or more, the required time will be increased to over several seconds or more, which is not satisfied in the field.